package file;

import java.io.File;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
           // create();
         delete();
    }
    // create()方法
    public static void create() throws IOException {
        for(int i = 0; i < 10; i++){
            File file = new File("test" + (i+1) + ".txt");
            file.createNewFile();
            System.out.println("正在创建第" + (i+1) + "个文件...");
        }
    }
    // delete()方法
    public static void delete() {
        for(int i = 0; i < 10; i++){
            File file = new File("test" + (i+1) + ".txt");
            file.delete();
            System.out.println("正在删除第" + (i+1) + "个文件...");
        }
    }
}
